package com.duyj.business.controller;

import com.duyj.business.service.BusinessService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BusinessController {

    Logger logger = LoggerFactory.getLogger(BusinessController.class);

    @Autowired
    private BusinessService businessService;

    @PostMapping("/doBusiness")
    public void doBusiness(String goodsCode, int goodsNumber, String userName) {
        logger.info("goodsCode:" + goodsCode);
        logger.info("goodsNumber:" + goodsNumber);
        logger.info("userName:" + userName);
        businessService.doBusiness(goodsCode, goodsNumber, userName);
    }

    @PostMapping("/checkOrder")
    public void checkOrder(Long id) {
        logger.info("id:" + id);
        businessService.checkOrder(id);
    }

}
